home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / gtk-2.0 / gdk / gdkgc.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-25  |  8.1 KB  |  299 lines

  1. /* GDK - The GIMP Drawing Kit
  2.  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Lesser General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.  * Lesser General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Lesser General Public
  15.  * License along with this library; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. /*
  21.  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
  22.  * file for a list of people on the GTK+ Team.  See the ChangeLog
  23.  * files for a list of changes.  These files are distributed with
  24.  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  25.  */
  26.  
  27. #ifndef __GDK_GC_H__
  28. #define __GDK_GC_H__
  29.  
  30. #include <gdk/gdkcolor.h>
  31. #include <gdk/gdktypes.h>
  32.  
  33. G_BEGIN_DECLS
  34.  
  35. typedef struct _GdkGCValues          GdkGCValues;
  36. typedef struct _GdkGCClass          GdkGCClass;
  37.  
  38. /* GC cap styles
  39.  *  CapNotLast:
  40.  *  CapButt:
  41.  *  CapRound:
  42.  *  CapProjecting:
  43.  */
  44. typedef enum
  45. {
  46.   GDK_CAP_NOT_LAST,
  47.   GDK_CAP_BUTT,
  48.   GDK_CAP_ROUND,
  49.   GDK_CAP_PROJECTING
  50. } GdkCapStyle;
  51.  
  52. /* GC fill types.
  53.  *  Solid:
  54.  *  Tiled:
  55.  *  Stippled:
  56.  *  OpaqueStippled:
  57.  */
  58. typedef enum
  59. {
  60.   GDK_SOLID,
  61.   GDK_TILED,
  62.   GDK_STIPPLED,
  63.   GDK_OPAQUE_STIPPLED
  64. } GdkFill;
  65.  
  66. /* GC function types.
  67.  *   Copy: Overwrites destination pixels with the source pixels.
  68.  *   Invert: Inverts the destination pixels.
  69.  *   Xor: Xor's the destination pixels with the source pixels.
  70.  *   Clear: set pixels to 0
  71.  *   And: source AND destination
  72.  *   And Reverse: source AND (NOT destination)
  73.  *   And Invert: (NOT source) AND destination
  74.  *   Noop: destination
  75.  *   Or: source OR destination
  76.  *   Nor: (NOT source) AND (NOT destination)
  77.  *   Equiv: (NOT source) XOR destination
  78.  *   Xor Reverse: source OR (NOT destination)
  79.  *   Copy Inverted: NOT source
  80.  *   Xor Inverted: (NOT source) OR destination
  81.  *   Nand: (NOT source) OR (NOT destination)
  82.  *   Set: set pixels to 1
  83.  */
  84. typedef enum
  85. {
  86.   GDK_COPY,
  87.   GDK_INVERT,
  88.   GDK_XOR,
  89.   GDK_CLEAR,
  90.   GDK_AND,
  91.   GDK_AND_REVERSE,
  92.   GDK_AND_INVERT,
  93.   GDK_NOOP,
  94.   GDK_OR,
  95.   GDK_EQUIV,
  96.   GDK_OR_REVERSE,
  97.   GDK_COPY_INVERT,
  98.   GDK_OR_INVERT,
  99.   GDK_NAND,
  100.   GDK_NOR,
  101.   GDK_SET
  102. } GdkFunction;
  103.  
  104. /* GC join styles
  105.  *  JoinMiter:
  106.  *  JoinRound:
  107.  *  JoinBevel:
  108.  */
  109. typedef enum
  110. {
  111.   GDK_JOIN_MITER,
  112.   GDK_JOIN_ROUND,
  113.   GDK_JOIN_BEVEL
  114. } GdkJoinStyle;
  115.  
  116. /* GC line styles
  117.  *  Solid:
  118.  *  OnOffDash:
  119.  *  DoubleDash:
  120.  */
  121. typedef enum
  122. {
  123.   GDK_LINE_SOLID,
  124.   GDK_LINE_ON_OFF_DASH,
  125.   GDK_LINE_DOUBLE_DASH
  126. } GdkLineStyle;
  127.  
  128. typedef enum
  129. {
  130.   GDK_CLIP_BY_CHILDREN    = 0,
  131.   GDK_INCLUDE_INFERIORS = 1
  132. } GdkSubwindowMode;
  133.  
  134. typedef enum
  135. {
  136.   GDK_GC_FOREGROUND    = 1 << 0,
  137.   GDK_GC_BACKGROUND    = 1 << 1,
  138.   GDK_GC_FONT           = 1 << 2,
  139.   GDK_GC_FUNCTION      = 1 << 3,
  140.   GDK_GC_FILL           = 1 << 4,
  141.   GDK_GC_TILE           = 1 << 5,
  142.   GDK_GC_STIPPLE       = 1 << 6,
  143.   GDK_GC_CLIP_MASK     = 1 << 7,
  144.   GDK_GC_SUBWINDOW     = 1 << 8,
  145.   GDK_GC_TS_X_ORIGIN   = 1 << 9,
  146.   GDK_GC_TS_Y_ORIGIN   = 1 << 10,
  147.   GDK_GC_CLIP_X_ORIGIN = 1 << 11,
  148.   GDK_GC_CLIP_Y_ORIGIN = 1 << 12,
  149.   GDK_GC_EXPOSURES     = 1 << 13,
  150.   GDK_GC_LINE_WIDTH    = 1 << 14,
  151.   GDK_GC_LINE_STYLE    = 1 << 15,
  152.   GDK_GC_CAP_STYLE     = 1 << 16,
  153.   GDK_GC_JOIN_STYLE    = 1 << 17
  154. } GdkGCValuesMask;
  155.  
  156. struct _GdkGCValues
  157. {
  158.   GdkColor        foreground;
  159.   GdkColor        background;
  160.   GdkFont       *font;
  161.   GdkFunction        function;
  162.   GdkFill        fill;
  163.   GdkPixmap       *tile;
  164.   GdkPixmap       *stipple;
  165.   GdkPixmap       *clip_mask;
  166.   GdkSubwindowMode  subwindow_mode;
  167.   gint            ts_x_origin;
  168.   gint            ts_y_origin;
  169.   gint            clip_x_origin;
  170.   gint            clip_y_origin;
  171.   gint            graphics_exposures;
  172.   gint            line_width;
  173.   GdkLineStyle        line_style;
  174.   GdkCapStyle        cap_style;
  175.   GdkJoinStyle        join_style;
  176. };
  177.  
  178. #define GDK_TYPE_GC              (gdk_gc_get_type ())
  179. #define GDK_GC(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC, GdkGC))
  180. #define GDK_GC_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GC, GdkGCClass))
  181. #define GDK_IS_GC(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC))
  182. #define GDK_IS_GC_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GC))
  183. #define GDK_GC_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GC, GdkGCClass))
  184.  
  185. struct _GdkGC
  186. {
  187.   GObject parent_instance;
  188.  
  189.   gint clip_x_origin;
  190.   gint clip_y_origin;
  191.   gint ts_x_origin;
  192.   gint ts_y_origin;
  193.  
  194.   GdkColormap *colormap;
  195. };
  196.  
  197. struct _GdkGCClass 
  198. {
  199.   GObjectClass parent_class;
  200.   
  201.   void (*get_values)     (GdkGC          *gc,
  202.               GdkGCValues    *values);
  203.   void (*set_values)     (GdkGC          *gc,
  204.               GdkGCValues    *values,
  205.               GdkGCValuesMask mask);
  206.   void (*set_dashes)     (GdkGC          *gc,
  207.               gint              dash_offset,
  208.               gint8           dash_list[],
  209.               gint            n);
  210.   
  211.   /* Padding for future expansion */
  212.   void         (*_gdk_reserved1)  (void);
  213.   void         (*_gdk_reserved2)  (void);
  214.   void         (*_gdk_reserved3)  (void);
  215.   void         (*_gdk_reserved4)  (void);
  216. };
  217.  
  218.  
  219. GType  gdk_gc_get_type            (void) G_GNUC_CONST;
  220. GdkGC *gdk_gc_new          (GdkDrawable        *drawable);
  221. GdkGC *gdk_gc_new_with_values      (GdkDrawable        *drawable,
  222.                    GdkGCValues        *values,
  223.                    GdkGCValuesMask   values_mask);
  224.  
  225. #ifndef GDK_DISABLE_DEPRECATED
  226. GdkGC *gdk_gc_ref          (GdkGC        *gc);
  227. void   gdk_gc_unref          (GdkGC        *gc);
  228. #endif
  229.  
  230. void   gdk_gc_get_values      (GdkGC        *gc,
  231.                    GdkGCValues        *values);
  232. void   gdk_gc_set_values          (GdkGC           *gc,
  233.                                    GdkGCValues       *values,
  234.                                    GdkGCValuesMask  values_mask);
  235. void   gdk_gc_set_foreground      (GdkGC        *gc,
  236.                    const GdkColor   *color);
  237. void   gdk_gc_set_background      (GdkGC        *gc,
  238.                    const GdkColor   *color);
  239. #ifndef GDK_DISABLE_DEPRECATED
  240. void   gdk_gc_set_font          (GdkGC        *gc,
  241.                    GdkFont        *font);
  242. #endif /* GDK_DISABLE_DEPRECATED */
  243. void   gdk_gc_set_function      (GdkGC        *gc,
  244.                    GdkFunction         function);
  245. void   gdk_gc_set_fill          (GdkGC        *gc,
  246.                    GdkFill         fill);
  247. void   gdk_gc_set_tile          (GdkGC        *gc,
  248.                    GdkPixmap        *tile);
  249. void   gdk_gc_set_stipple      (GdkGC        *gc,
  250.                    GdkPixmap        *stipple);
  251. void   gdk_gc_set_ts_origin      (GdkGC        *gc,
  252.                    gint             x,
  253.                    gint             y);
  254. void   gdk_gc_set_clip_origin      (GdkGC        *gc,
  255.                    gint             x,
  256.                    gint             y);
  257. void   gdk_gc_set_clip_mask      (GdkGC        *gc,
  258.                    GdkBitmap        *mask);
  259. void   gdk_gc_set_clip_rectangle  (GdkGC        *gc,
  260.                    GdkRectangle        *rectangle);
  261. void   gdk_gc_set_clip_region      (GdkGC        *gc,
  262.                    GdkRegion        *region);
  263. void   gdk_gc_set_subwindow      (GdkGC        *gc,
  264.                    GdkSubwindowMode  mode);
  265. void   gdk_gc_set_exposures      (GdkGC        *gc,
  266.                    gboolean         exposures);
  267. void   gdk_gc_set_line_attributes (GdkGC        *gc,
  268.                    gint             line_width,
  269.                    GdkLineStyle         line_style,
  270.                    GdkCapStyle         cap_style,
  271.                    GdkJoinStyle         join_style);
  272. void   gdk_gc_set_dashes          (GdkGC            *gc,
  273.                    gint                 dash_offset,
  274.                    gint8             dash_list[],
  275.                    gint              n);
  276. void   gdk_gc_offset              (GdkGC            *gc,
  277.                    gint              x_offset,
  278.                    gint              y_offset);
  279. void   gdk_gc_copy          (GdkGC        *dst_gc,
  280.                    GdkGC        *src_gc);
  281.  
  282.  
  283. void         gdk_gc_set_colormap     (GdkGC          *gc,
  284.                       GdkColormap    *colormap);
  285. GdkColormap *gdk_gc_get_colormap     (GdkGC          *gc);
  286. void         gdk_gc_set_rgb_fg_color (GdkGC          *gc,
  287.                       const GdkColor *color);
  288. void         gdk_gc_set_rgb_bg_color (GdkGC          *gc,
  289.                       const GdkColor *color);
  290. GdkScreen *  gdk_gc_get_screen         (GdkGC          *gc);
  291.  
  292. #ifndef GDK_DISABLE_DEPRECATED
  293. #define gdk_gc_destroy                 gdk_gc_unref
  294. #endif /* GDK_DISABLE_DEPRECATED */
  295.  
  296. G_END_DECLS
  297.  
  298. #endif /* __GDK_DRAWABLE_H__ */
  299.